<?php

class Application_Form_Nachrichterstellen extends Zend_Form
{
	protected $_user = array();
	
	public function getUser() {
		return $this->_user;
	}
	
	public function setUser($user){
		$this->_user = $user;
	}
	
public function init()
    {
        $this->setName("nachricht");
        $this->setMethod('post');
        
        
        // create text input for name
        /*
        $name = new Zend_Form_Element_Text('empfanger');
        $name->setLabel('Empfaenger:')
			->setOptions(array('id' => 'fname'))
        	->setRequired(true);
        	*/
        
//         $empfanger = new Zend_Form_Element_Select('empfanger');

        $empfanger = new Zend_Form_Element_Select('empfanger');
        $empfanger ->setLabel('Empfanger*:')
        	->addMultiOptions( $this->_user
        );
        

        $titel = new Zend_Form_Element_Text('titel');
        $titel->setLabel('Titel*:')
        	->setOptions(array('id' => 'fname'))
        	->setRequired(true)
        	->addFilter('HtmlEntities');
        
        // create text area for Nachrichten
        $text = new Zend_Form_Element_Textarea('text');
        $text->setLabel('Nachricht*:')
        	->setOptions(array(
        		'id' => 'comment',
        		'rows' => '10',
        		'cols' => '60',
        		))
        	->setRequired(true)
        	->addFilter('HtmlEntities');
        		
		// create submit button
		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setLabel('Submit')
		->setOptions(array('class' => 'submit'));
		
		
        // attach elements to form
        $this->addElement($empfanger)
        		->addElement($titel)
        		->addElement($text)
        		->addElement($submit);
	}
}